﻿using PetaPoco;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace QD.PushManager.Domain
{
    /// <summary>
    /// 订阅宝产品-基本信息
    /// </summary>
    [TableName("sql_s003.dbo.vIFO_Product")]
    [PrimaryKey("ProductID")]
    public class Product
    {
        /// <summary>
        /// 产品ID
        /// </summary>
        public int ProductId { get; set; }
        /// <summary>
        /// 会员ID
        /// </summary>
        public int UserId { get; set; }
        /// <summary>
        /// 标题
        /// </summary>
        public string Title { get; set; }
        /// <summary>
        /// 0普通商品,2置顶信息
        /// </summary>
        public int CategoryId { get; set; }
        /// <summary>
        /// 推送次数
        /// </summary>
        public int Tags { get; set; }
        /// <summary>
        /// 上次推送的关键词索引
        /// </summary>
        public int TemplateId { get; set; }
        /// <summary>
        /// 关键词
        /// </summary>
        public string Keywords { get; set; }
        /// <summary>
        /// 封面图片
        /// </summary>
        public string PicUrl { get; set; }
        /// <summary>
        /// 文章来源网址
        /// </summary>
        public string Copyfrom { get; set; }
        /// <summary>
        /// 公司名
        /// </summary>
        public string EditorName { get; set; }
        /// <summary>
        /// 封面图片在原文中是否显示（0显示,1不显示）
        /// </summary>
        public int MaxCharPerPage { get; set; }
        /// <summary>
        /// 自定义排序
        /// </summary>
        public int EditorId { get; set; }
        /// <summary>
        /// 产品分组(0商汇通,1微推广,2微街宝)
        /// </summary>
        public int ColumnId { get; set; }

        /// <summary>
        /// 草稿箱(0非草稿箱, 1草稿箱)
        /// </summary>
        public int ShowCommentLink { get; set; }
        /// <summary>
        /// 状态(4 审核通过, 存储2的次方值)
        /// </summary>
        public int Status { get; set; }

        /// <summary>
        /// 是否删除(0未删除, 1 已删除)
        /// </summary>
        public int Deleted { get; set; }

        /// <summary>
        /// 暂时 固定值为：4
        /// </summary>
        public int Kind { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime Created { get; set; }
        /// <summary>
        /// 更新时间
        /// </summary>
        public DateTime Updated { get; set; }
        public Product()
        {
            Deleted = 0;
            Kind = 4;
            Status = 4;
            ShowCommentLink = 1;
            ColumnId = 1;
            Updated = Created = DateTime.Now;
        }
    }

    /// <summary>
    /// 订阅宝产品-内容详情
    /// </summary>
    [TableName("sql_s003.dbo.vIFO_Product_Detail")]
    public class ProductDetail
    {
        /// <summary>
        /// 产品ID
        /// </summary>
        public int FK_ProductId { get; set; }
        /// <summary>
        /// 产品内容
        /// </summary>
        public string Details { get; set; }
    }

    /// <summary>
    /// 订阅宝商品-推送日志
    /// </summary>
    [TableName("sql_s003.dbo.vifo_product_log_wx")]
    public class ProductLog
    {
        public int itemid { get; set; }
        public int UserId { get; set; }
        public string ProductIds { get; set; }
        public string article_ids { get; set; }
        public string CollBackMsg { get; set; }
        public string msg_id { get; set; }
        public string callback_status { get; set; }
        public string callback_count { get; set; }
        public string status { get; set; }
        public string tort_pid { get; set; }
        public string tort_aid { get; set; }
        public DateTime addtime { get; set; }
    }


    /// <summary>
    /// 订阅宝商品-与小程序商品关联
    /// </summary>
    [TableName("sql_s003.dbo.vifo_product_union")]
    public class ProductUnion
    {
        /// <summary>
        /// 订阅宝商品ID
        /// </summary>
        public int ProductId { get; set; }

        /// <summary>
        /// 订阅宝-会员ID
        /// </summary>
        public int UserId { get; set; }
        /// <summary>
        /// 小程序商品ID
        /// </summary>
        public int UnionProductId { get; set; }

        /// <summary>
        /// 关联的商品来源(1 小程序项目,2 微街秀项目)
        /// </summary>
        public int Source { get; set; }

        public DateTime AddTime { get; set; }
    }


    public class ProductView
    {
        /// <summary>
        /// 产品ID
        /// </summary>
        public int ProductId { get; set; }
        /// <summary>
        /// 文章ID
        /// </summary>
        public int ArticleId { get; set; }
        /// <summary>
        /// 会员ID
        /// </summary>
        public int UserId { get; set; }
        /// <summary>
        /// 标题
        /// </summary>
        public string Title { get; set; }
        /// <summary>
        /// 0普通商品,2置顶信息
        /// </summary>
        public int CategoryId { get; set; }
        /// <summary>
        /// 推送次数
        /// </summary>
        public int Tags { get; set; }
        /// <summary>
        /// 上次推送的关键词索引
        /// </summary>
        public int TemplateId { get; set; }
        /// <summary>
        /// 关键词
        /// </summary>
        public string Keywords { get; set; }
        /// <summary>
        /// 封面图片
        /// </summary>
        public string PicUrl { get; set; }
        /// <summary>
        /// 文章来源网址
        /// </summary>
        public string Copyfrom { get; set; }
        /// <summary>
        /// 公司名
        /// </summary>
        public string EditorName { get; set; }
        /// <summary>
        /// 公众号登录账号(采用API推送时,用不到此数据)
        /// </summary>
        public string Tag { get; set; }
        /// <summary>
        /// 微街宝大图作为微推广的封面
        /// </summary>
        public string ProductNum { get; set; }
        /// <summary>
        /// 内容详情
        /// </summary>
        public string Details { get; set; }
        /// <summary>
        /// 封面图片在原文中是否显示（0显示,1不显示）
        /// </summary>
        public int MaxCharPerPage { get; set; }
        /// <summary>
        /// 自定义排序
        /// </summary>
        public int EditorId { get; set; }
        /// <summary>
        /// 产品分组(0商汇通,1微推广,2微街宝)
        /// </summary>
        public int ColumnId { get; set; }
    }
}